import React,{useState,useEffect} from 'react'
import Luo from 'iscroll-luo';
import {useDispatch,useSelector} from "react-redux"
import * as action from "../action"
function Onpull() {
    let store = useSelector((state)=>{
        return {
            ...state.shopreducer
        }
    })
    let dispatch = useDispatch()
    let onDown = ()=>{
        dispatch(action.getpulllist())
    }
    let onUp = ()=>{
        dispatch(action.getpulllist("up"))
    // console.log("ouUp");
    }
    useEffect(()=>{
        dispatch(action.getpulllist())
    },[])
    return (
        <div style={{ position: 'relative', height: '100vh' }}>
            <Luo
                id='id'
                onDown={() => onDown()}
                onUp={() => onUp()}
            >
                {
                store.pullarr.map((v, i) =>
                        <div key={i}>{v.tit}</div>
                    )
                }
            </Luo>
        </div>
    )
}

export default Onpull